ace.define("ace/mode/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text","ace/mode/xml_highlight_rules","ace/mode/behaviour/xml","ace/mode/folding/xml"],function(e,t,n){var r=e("../lib/oop"),a=e("../lib/lang"),o=e("./text").Mode,i=e("./xml_highlight_rules").XmlHighlightRules,l=e("./behaviour/xml").XmlBehaviour,u=e("./folding/xml").FoldMode,s=function(){this.HighlightRules=i,this.$behaviour=new l,this.foldingRules=new u};r.inherits(s,o),function(){this.voidElements=a.arrayToMap([]),this.blockComment={start:"<!--",end:"-->"},this.$id="ace/mode/xml"}.call(s.prototype),t.Mode=s}),ace.define("ace/mode/xml_highlight_rules",["require","exports","module","ace/lib/oop","ace/mode/text_highlight_rules"],function(e,t,n){var r=e("../lib/oop"),a=e("./text_highlight_rules").TextHighlightRules,o=function(e){this.$rules={start:[{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\[",next:"cdata"},{token:["punctuation.xml-decl.xml","keyword.xml-decl.xml"],regex:"(<\\?)(xml)(?=[\\s])",next:"xml_decl",caseInsensitive:!0},{token:["punctuation.instruction.xml","keyword.instruction.xml"],regex:"(<\\?)([-_a-zA-Z0-9]+)",next:"processing_instruction"},{token:"comment.xml",regex:"<\\!--",next:"comment"},{token:["xml-pe.doctype.xml","xml-pe.doctype.xml"],regex:"(<\\!)(DOCTYPE)(?=[\\s])",next:"doctype",caseInsensitive:!0},{include:"tag"},{token:"text.end-tag-open.xml",regex:"</"},{token:"text.tag-open.xml",regex:"<"},{include:"reference"},{defaultToken:"text.xml"}],xml_decl:[{token:"entity.other.attribute-name.decl-attribute-name.xml",regex:"(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"},{token:"keyword.operator.decl-attribute-equals.xml",regex:"="},{include:"whitespace"},{include:"string"},{token:"punctuation.xml-decl.xml",regex:"\\?>",next:"start"}],processing_instruction:[{token:"punctuation.instruction.xml",regex:"\\?>",next:"start"},{defaultToken:"instruction.xml"}],doctype:[{include:"whitespace"},{include:"string"},{token:"xml-pe.doctype.xml",regex:">",next:"start"},{token:"xml-pe.xml",regex:"[-_a-zA-Z0-9:]+"},{token:"punctuation.int-subset",regex:"\\[",push:"int_subset"}],int_subset:[{token:"text.xml",regex:"\\s+"},{token:"punctuation.int-subset.xml",regex:"]",next:"pop"},{token:["punctuation.markup-decl.xml","keyword.markup-decl.xml"],regex:"(<\\!)([-_a-zA-Z0-9]+)",push:[{token:"text",regex:"\\s+"},{token:"punctuation.markup-decl.xml",regex:">",next:"pop"},{include:"string"}]}],cdata:[{token:"string.cdata.xml",regex:"\\]\\]>",next:"start"},{token:"text.xml",regex:"\\s+"},{token:"text.xml",regex:"(?:[^\\]]|\\](?!\\]>))+"}],comment:[{token:"comment.xml",regex:"-->",next:"start"},{defaultToken:"comment.xml"}],reference:[{token:"constant.language.escape.reference.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],attr_reference:[{token:"constant.language.escape.reference.attribute-value.xml",regex:"(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"}],tag:[{token:["meta.tag.punctuation.tag-open.xml","meta.tag.punctuation.end-tag-open.xml","meta.tag.tag-name.xml"],regex:"(?:(<)|(</))((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start"}]}],tag_whitespace:[{token:"text.tag-whitespace.xml",regex:"\\s+"}],whitespace:[{token:"text.whitespace.xml",regex:"\\s+"}],string:[{token:"string.xml",regex:"'",push:[{token:"string.xml",regex:"'",next:"pop"},{defaultToken:"string.xml"}]},{token:"string.xml",regex:'"',push:[{token:"string.xml",regex:'"',next:"pop"},{defaultToken:"string.xml"}]}],attributes:[{token:"entity.other.attribute-name.xml",regex:"(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"},{token:"keyword.operator.attribute-equals.xml",regex:"="},{include:"tag_whitespace"},{include:"attribute_value"}],attribute_value:[{token:"string.attribute-value.xml",regex:"'",push:[{token:"string.attribute-value.xml",regex:"'",next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]},{token:"string.attribute-value.xml",regex:'"',push:[{token:"string.attribute-value.xml",regex:'"',next:"pop"},{include:"attr_reference"},{defaultToken:"string.attribute-value.xml"}]}]},this.constructor===o&&this.normalizeRules()};(function(){this.embedTagRules=function(e,t,n){this.$rules.tag.unshift({token:["meta.tag.punctuation.tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(<)("+n+"(?=\\s|>|$))",next:[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:t+"start"}]}),this.$rules[n+"-end"]=[{include:"attributes"},{token:"meta.tag.punctuation.tag-close.xml",regex:"/?>",next:"start",onMatch:function(e,t,n){return n.splice(0),this.token}}],this.embedRules(e,t,[{token:["meta.tag.punctuation.end-tag-open.xml","meta.tag."+n+".tag-name.xml"],regex:"(</)("+n+"(?=\\s|>|$))",next:n+"-end"},{token:"string.cdata.xml",regex:"<\\!\\[CDATA\\["},{token:"string.cdata.xml",regex:"\\]\\]>"}])}}).call(a.prototype),r.inherits(o,a),t.XmlHighlightRules=o}),ace.define("ace/mode/behaviour/xml",["require","exports","module","ace/lib/oop","ace/mode/behaviour","ace/token_iterator"],function(e,t,n){function r(e,t){return e.type.lastIndexOf(t+".xml")>-1}var a=e("../../lib/oop"),o=e("../behaviour").Behaviour,i=e("../../token_iterator").TokenIterator,l=function(){this.add("string_dquotes","insertion",function(e,t,n,a,o){if('"'==o||"'"==o){var l=o,u=a.doc.getTextRange(n.getSelectionRange());if(""!==u&&"'"!==u&&'"'!=u&&n.getWrapBehavioursEnabled())return{text:l+u+l,selection:!1};var s=n.getCursorPosition(),g=a.doc.getLine(s.row),c=g.substring(s.column,s.column+1),m=new i(a,s.row,s.column),x=m.getCurrentToken();if(c==l&&(r(x,"attribute-value")||r(x,"string")))return{text:"",selection:[1,1]};if(x||(x=m.stepBackward()),!x)return;for(;r(x,"tag-whitespace")||r(x,"whitespace");)x=m.stepBackward();var d=!c||c.match(/\s/);if(r(x,"attribute-equals")&&(d||">"==c)||r(x,"decl-attribute-equals")&&(d||"?"==c))return{text:l+l,selection:[1,1]}}}),this.add("string_dquotes","deletion",function(e,t,n,r,a){var o=r.doc.getTextRange(a);if(!a.isMultiLine()&&('"'==o||"'"==o)){var i=r.doc.getLine(a.start.row),l=i.substring(a.start.column+1,a.start.column+2);if(l==o)return a.end.column++,a}}),this.add("autoclosing","insertion",function(e,t,n,a,o){if(">"==o){var l=n.getCursorPosition(),u=new i(a,l.row,l.column),s=u.getCurrentToken()||u.stepBackward();if(!s||!(r(s,"tag-name")||r(s,"tag-whitespace")||r(s,"attribute-name")||r(s,"attribute-equals")||r(s,"attribute-value")))return;if(r(s,"reference.attribute-value"))return;if(r(s,"attribute-value")){var g=s.value.charAt(0);if('"'==g||"'"==g){var c=s.value.charAt(s.value.length-1),m=u.getCurrentTokenColumn()+s.value.length;if(m>l.column||m==l.column&&g!=c)return}}for(;!r(s,"tag-name");)s=u.stepBackward();var x=u.getCurrentTokenRow(),d=u.getCurrentTokenColumn();if(r(u.stepBackward(),"end-tag-open"))return;var h=s.value;if(x==l.row&&(h=h.substring(0,l.column-d)),this.voidElements.hasOwnProperty(h.toLowerCase()))return;return{text:"></"+h+">",selection:[1,1]}}}),this.add("autoindent","insertion",function(e,t,n,r,a){if("\n"==a){var o=n.getCursorPosition(),i=r.getLine(o.row),l=i.substring(o.column,o.column+2);if("</"==l){var u=this.$getIndent(i),s=u+r.getTabString();return{text:"\n"+s+"\n"+u,selection:[1,s.length,1,s.length]}}}})};a.inherits(l,o),t.XmlBehaviour=l}),ace.define("ace/mode/folding/xml",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/range","ace/mode/folding/fold_mode","ace/token_iterator"],function(e,t,n){function r(e,t){return e.type.lastIndexOf(t+".xml")>-1}var a=e("../../lib/oop"),o=e("../../lib/lang"),i=e("../../range").Range,l=e("./fold_mode").FoldMode,u=e("../../token_iterator").TokenIterator,s=t.FoldMode=function(e,t){l.call(this),this.voidElements=a.mixin(e||{},t||{})};a.inherits(s,l);var g=function(){this.tagName="",this.closing=!1,this.selfClosing=!1,this.start={row:0,column:0},this.end={row:0,column:0}};(function(){this.getFoldWidget=function(e,t,n){var r=this._getFirstTagInLine(e,n);return r?r.closing||!r.tagName&&r.selfClosing?"markbeginend"==t?"end":"":!r.tagName||r.selfClosing||this.voidElements.hasOwnProperty(r.tagName.toLowerCase())?"":this._findEndTagInLine(e,n,r.tagName,r.end.column)?"":"start":""},this._getFirstTagInLine=function(e,t){for(var n=e.getTokens(t),a=new g,o=0;o<n.length;o++){var i=n[o];if(r(i,"tag-open")){if(a.end.column=a.start.column+i.value.length,a.closing=r(i,"end-tag-open"),i=n[++o],!i)return null;for(a.tagName=i.value,a.end.column+=i.value.length,o++;o<n.length;o++)if(i=n[o],a.end.column+=i.value.length,r(i,"tag-close")){a.selfClosing="/>"==i.value;break}return a}if(r(i,"tag-close"))return a.selfClosing="/>"==i.value,a;a.start.column+=i.value.length}return null},this._findEndTagInLine=function(e,t,n,a){for(var o=e.getTokens(t),i=0,l=0;l<o.length;l++){var u=o[l];if(i+=u.value.length,!(a>i)&&r(u,"end-tag-open")&&(u=o[l+1],u&&u.value==n))return!0}return!1},this._readTagForward=function(e){var t=e.getCurrentToken();if(!t)return null;var n=new g;do if(r(t,"tag-open"))n.closing=r(t,"end-tag-open"),n.start.row=e.getCurrentTokenRow(),n.start.column=e.getCurrentTokenColumn();else if(r(t,"tag-name"))n.tagName=t.value;else if(r(t,"tag-close"))return n.selfClosing="/>"==t.value,n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length,e.stepForward(),n;while(t=e.stepForward());return null},this._readTagBackward=function(e){var t=e.getCurrentToken();if(!t)return null;var n=new g;do{if(r(t,"tag-open"))return n.closing=r(t,"end-tag-open"),n.start.row=e.getCurrentTokenRow(),n.start.column=e.getCurrentTokenColumn(),e.stepBackward(),n;r(t,"tag-name")?n.tagName=t.value:r(t,"tag-close")&&(n.selfClosing="/>"==t.value,n.end.row=e.getCurrentTokenRow(),n.end.column=e.getCurrentTokenColumn()+t.value.length)}while(t=e.stepBackward());return null},this._pop=function(e,t){for(;e.length;){var n=e[e.length-1];if(!t||n.tagName==t.tagName)return e.pop();if(this.voidElements.hasOwnProperty(t.tagName))return;{if(!this.voidElements.hasOwnProperty(n.tagName))return null;e.pop()}}},this.getFoldWidgetRange=function(e,t,n){var r=this._getFirstTagInLine(e,n);if(!r)return null;var a=r.closing||r.selfClosing,o=[],l;if(a){for(var s=new u(e,n,r.end.column),g={row:n,column:r.start.column};l=this._readTagBackward(s);)if(l.selfClosing){if(!o.length)return l.start.column+=l.tagName.length+2,l.end.column-=2,i.fromPoints(l.start,l.end)}else if(l.closing)o.push(l);else if(this._pop(o,l),0==o.length)return l.start.column+=l.tagName.length+2,i.fromPoints(l.start,g)}else for(var s=new u(e,n,r.start.column),c={row:n,column:r.start.column+r.tagName.length+2};l=this._readTagForward(s);)if(l.selfClosing){if(!o.length)return l.start.column+=l.tagName.length+2,l.end.column-=2,i.fromPoints(l.start,l.end)}else if(l.closing){if(this._pop(o,l),0==o.length)return i.fromPoints(c,l.start)}else o.push(l)}}).call(s.prototype)});